package com.zjq.dots
{
	import flash.display.Sprite;

	/**
	 * 画方形点的类
	 **/
	public class SquareDot extends Sprite
	{
		private var _len:Number;  //方形边长
		private var _color:uint;  //方形边长
		public function SquareDot(len:Number, color:uint = 0x999999)
		{
			_len = len;
			_color = color;
			drawSquare();
		}
		
		/**
		 * 画方形
		 **/
		private function drawSquare():void
		{
			this.graphics.clear();
			this.graphics.beginFill(_color);
			this.graphics.drawRect(0, 0, _len, _len);
			this.graphics.endFill();
		}
		
		/**
		 *设置中心点 
		 **/
		public function centerPoint(pCenterX:Number, pCenterY:Number):void
		{
			this.x = pCenterX - _len*0.5;
			this.y = pCenterY - _len*0.5;
		}
	}
}